package com.tanhua.server.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.server.mapper.SettingsMapper;
import com.tanhua.server.pojo.Settings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: JinboYang
 * @Description:
 * @Date: Created in 下午 14:03 2021/1/16
 * @ModifiedBy:
 */
@Service
public class SettingsService {
    @Autowired
    private SettingsMapper settingsMapper;

    /**
     * @Description: 根据id查询配置
     * @Param:[usrId]
     * @return:com.tanhua.server.pojo.Settings
     * @Author:JinboYang
     * @Date:2021/1/16
     */
    public Settings querySettings(Long usrId) {
        QueryWrapper<Settings> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", usrId);
        return this.settingsMapper.selectOne(queryWrapper);
    }
}
